﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 道路运输从业人员无纸化考试系统
{
    public class rizhi
    {
        public static int maxCount = 5000;
        //public static int log(string uuid)
        //{
        //    MySQLHelper mySQLHelper = new MySQLHelper();
        //    string strSql = "select * from b where uuid='" + uuid + "'";
        //    var result = mySQLHelper.getMySqlRead(strSql, new MySql.Data.MySqlClient.MySqlParameter());
        //    if (result.Rows.Count == 0)
        //    {
        //        strSql = "select count(1) as count from b";
        //        result = mySQLHelper.getMySqlRead(strSql, new MySql.Data.MySqlClient.MySqlParameter());
        //        if (Convert.ToInt32(result.Rows[0][0]) >= maxCount)
        //        {
        //            return -1;
        //        }
        //        else
        //        {
        //            strSql = "insert into b(uuid) values('" + uuid + "')";
        //            return mySQLHelper.getMySqlCom(strSql, new MySql.Data.MySqlClient.MySqlParameter());
        //        }
        //    }
        //    return 0;
        //}


        public static int log(string uuid)
        {
            //return Convert.ToInt32(WSHelper.InvokeWebService("http://localhost:44306/ClientService.asmx", "ClientService", "log", new string[] { uuid, "1.0.0" }));
            int result = Convert.ToInt32(WSHelper.InvokeWebService("http://47.75.211.133:8031/ClientService.asmx", "ClientService", "log", new string[] { uuid, "1.0.0" }));
            return result;
        }
    }
}
